UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e95c4p7J/wC9Fbn81/ybu0OTbRy8JexU6dzCVXi4jrU='
WHERE
key_id = 'cb1db0756f88cdfd90e035d7639145896ef92d2967b1762e67e1fcce40008e65'
AND (
token = 'e95c4p7J/wC9Fbn81/ybu0OTbRy8JexU6dzCVXi4jrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)