UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1EHJOi2cr550jb82AnA9EdG7gbhRlSWrId/2XohEYTs='
WHERE
key_id = 'ad8420ad3ebb8860f2a54b699ebd6a593548a8a09054a6aa5db9840e0ed86684'
AND (
token = '1EHJOi2cr550jb82AnA9EdG7gbhRlSWrId/2XohEYTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)