UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8EVoUS1H9gUUG2e1PCO2TZnYECa6B1YR4sUo67mHvJg='
WHERE
key_id = 'bf3c76cd006518b8410b851c8f2dcc9f400f6034de85e9bf358c665c46286d96'
AND (
token = '8EVoUS1H9gUUG2e1PCO2TZnYECa6B1YR4sUo67mHvJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)