UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2I9GEQwf/aYltcevUiy9ldVjz07BPFvRocsUVAhy4DM='
WHERE
key_id = 'dfe671ddb94b121702c8f862d1dc520c461604290a7bc741d5c4a1d30e41c9b1'
AND (
token = '2I9GEQwf/aYltcevUiy9ldVjz07BPFvRocsUVAhy4DM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)