UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fQJDbaADKcpAwLyuZlWB9Vs40O4CvCUzFeLJbODQ9W8='
WHERE
key_id = '7ecea5731672961cf35c222080bfbe0794726efcf597c731ba31efd8953f5b16'
AND (
token = 'fQJDbaADKcpAwLyuZlWB9Vs40O4CvCUzFeLJbODQ9W8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)