UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+IIyLe03TmmrwnkqVAF/RIqg+IHmT8czveuCN1DD/Pc='
WHERE
key_id = '97339baf5b3fc65b452abf1559308d5bf04fe179f3299fa9e5238e9bca1f1a3a'
AND (
token = '+IIyLe03TmmrwnkqVAF/RIqg+IHmT8czveuCN1DD/Pc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)