UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OYFHVeI+MUfKPR2kA1Kw47YhfykQTMA1unsO63qtOw4='
WHERE
key_id = '51669aa6453127fc0e677c1bff4d14516f8c60fa7680afbe6fcf1aba8c43b3f0'
AND (
token = 'OYFHVeI+MUfKPR2kA1Kw47YhfykQTMA1unsO63qtOw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)