UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7x13m3sje77puXPunKoUKKU1IQ8is//Ft/6VlcJ+w3o='
WHERE
key_id = 'c317ad0f1618448a5bfe31c01f8aaac88197b2918ea6b4f73db37a803b24e0da'
AND (
token = '7x13m3sje77puXPunKoUKKU1IQ8is//Ft/6VlcJ+w3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)