UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uhbsdjWeUP4pU1t25sx7FSGT1aXC9zUM+o1TlEAocXw='
WHERE
key_id = 'fcce3e899562ca3d6e5af9d898b80c96b960118a4405bb5ecf3add567671ed46'
AND (
token = 'uhbsdjWeUP4pU1t25sx7FSGT1aXC9zUM+o1TlEAocXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)