UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OfFxoWTWLB11l1oeljhBDv/5KoLuGOXPWzP+p076AfM='
WHERE
key_id = 'aa298a9486ea2bcc2d8c77368cd06709f41c2739d80b0dcb97f5405ea40ca94f'
AND (
token = 'OfFxoWTWLB11l1oeljhBDv/5KoLuGOXPWzP+p076AfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)