UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RlcD4O9fZZ/IoodUhkIyqtfS0xq6qU8UHo6JGsShZHE='
WHERE
key_id = 'ee669d21e244495714ad88f156863830cbb425f38662b8cf6dfcecbeb825c605'
AND (
token = 'RlcD4O9fZZ/IoodUhkIyqtfS0xq6qU8UHo6JGsShZHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)