UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QGjOFHxletrvgCiQpbLWB9pV6FpMvip6R8yuufYfYms='
WHERE
key_id = '458915473b99d305e4c7f9a5d602cfa2adbb5b8adf40a0310f81f9d120a7dffe'
AND (
token = 'QGjOFHxletrvgCiQpbLWB9pV6FpMvip6R8yuufYfYms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)