UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2FFN3eOLJcdbQ9r4jXYGAA7VzxksmolH5h23kXDEAYQ='
WHERE
key_id = '4a327a3d5258f28eb2fcd3133e29e7892e8864580e5f8cf9bca013377956c52e'
AND (
token = '2FFN3eOLJcdbQ9r4jXYGAA7VzxksmolH5h23kXDEAYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)