UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nJfSLRi3TgpiSQ6vJE5XrYAyy1LZs06qCYCPMtEF6D8='
WHERE
key_id = '68ae05b9125a695cc1cf344adc30daf222c3ddf1153397d1670c1c9b277c0e04'
AND (
token = 'nJfSLRi3TgpiSQ6vJE5XrYAyy1LZs06qCYCPMtEF6D8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)