UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8/U5zMhhl/jeqG44pAseSIlXlQeJncEEsspPG99Upw='
WHERE
key_id = 'e4f936531b0c19748d68a4e6d598a698a96e678b51647558a86cd2b3b633caa1'
AND (
token = 'F8/U5zMhhl/jeqG44pAseSIlXlQeJncEEsspPG99Upw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)