UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98+cqvba8lzsdQUscjtctpDEXzSWxZbNXU9dJDN4XRo='
WHERE
key_id = 'e5fe85c17b6ebd0d921742ff8fe20c0c4ed6be8c1ae9e8a7a267a70588e3aa70'
AND (
token = '98+cqvba8lzsdQUscjtctpDEXzSWxZbNXU9dJDN4XRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)