UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGcH7hSQc15a1S2Co+5CE8LSsjWeFYE+sCcr9/NPsNk='
WHERE
key_id = '7b154f79b405fb1a4e89dc04e2f21cddb1f948ea93c23aa6c50f538ed8fc4e15'
AND (
token = 'wGcH7hSQc15a1S2Co+5CE8LSsjWeFYE+sCcr9/NPsNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)