UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7aX/3r3228tktDrrT85PXPKTX48LV4ZObOw1BkPbZHA='
WHERE
key_id = 'a31ff5cb304f0ee35ea32f6c06167c11b220de4b78e9473d3be19fd8f30f1c06'
AND (
token = '7aX/3r3228tktDrrT85PXPKTX48LV4ZObOw1BkPbZHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)