UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OoZCDK+EA4lDJaDloZUUjURntVYesnPDG2X9gmqFDc4='
WHERE
key_id = '498ed2c16337562d2b5a89d398cb17ff4d70f58f344c72b0944c4e06aed844fb'
AND (
token = 'OoZCDK+EA4lDJaDloZUUjURntVYesnPDG2X9gmqFDc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)