UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NppY09K14clawE97H4izMWeaBuEIq1nLnbdGCPyrSRI='
WHERE
key_id = 'a2607f9968c27ad0b75644a9283aadc0fcfa023500ff1d3ae51a6b0b375a8287'
AND (
token = 'NppY09K14clawE97H4izMWeaBuEIq1nLnbdGCPyrSRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)