UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Os/PcWpEjUCFrlOZ79ZKnLo0DHaboHfqjKsOxWQeTR0='
WHERE
key_id = '18f1a7ec7514d1c67dab855c06af244014fc0667df18d626bdd26eeef7789633'
AND (
token = 'Os/PcWpEjUCFrlOZ79ZKnLo0DHaboHfqjKsOxWQeTR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)