UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zz2qZJpSEiL8cKXeaukq9rhdKkGrIuuc10ucOHbBD5Q='
WHERE
key_id = '5d2e8a9c2bbd29536ae1894d6b7b04d8762d43364762cec345060688060dd03e'
AND (
token = 'zz2qZJpSEiL8cKXeaukq9rhdKkGrIuuc10ucOHbBD5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)