UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BZkNXGGgGLYNu7AJ1rqTBC7G1TO+SPlnfTHDLuDYUZE='
WHERE
key_id = '9bdf8327f5dab04a454be441bf3d6888168ede8fbade52633a45641bfd4d29da'
AND (
token = 'BZkNXGGgGLYNu7AJ1rqTBC7G1TO+SPlnfTHDLuDYUZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)