UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NIBV39jvsg43PfVGPMd5rVXfhgu17pq2N2bkdGm/JA='
WHERE
key_id = 'db2c513ad5b7542fce136710bef714b20075559e1eb0e724cd616dc85eef7690'
AND (
token = '4NIBV39jvsg43PfVGPMd5rVXfhgu17pq2N2bkdGm/JA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)