UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37TMOtR5YvY6E7d0j1Hjl1qRKtjq2vGZLYunKrICc90='
WHERE
key_id = '0a58d27a0ce1c43e05a2e157bb29155d93d8880561d2cc32be45be7ae970db5e'
AND (
token = '37TMOtR5YvY6E7d0j1Hjl1qRKtjq2vGZLYunKrICc90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)