UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dB2ouwnWO84d4DaNaCuwhiIMEuGgqC8Xj7ChDh35PxE='
WHERE
key_id = 'ee0e0ab062adf2d0cb442afd6fe7ca879153c7b0108a86ca4cd843b64f55d013'
AND (
token = 'dB2ouwnWO84d4DaNaCuwhiIMEuGgqC8Xj7ChDh35PxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)