UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'svIy+mCMprVHa+ixN3giuimObTIroWiJh8IeJ76650g='
WHERE
key_id = 'c484a67ff148afb07d32c3af25dde1176e13fe4c9aa813abc507e518d0646fe5'
AND (
token = 'svIy+mCMprVHa+ixN3giuimObTIroWiJh8IeJ76650g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)