UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UhX3SADvDe2jfnBxd0Z5s4yvX1FGbVO+5J89pxjtMDo='
WHERE
key_id = 'ea992fed0cdfb443f9b66b5e52863fb8fa93b1363fbc7424698171e49935aac7'
AND (
token = 'UhX3SADvDe2jfnBxd0Z5s4yvX1FGbVO+5J89pxjtMDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)