UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's0ODy5STOxL6uuyQegVxxaUWY7j42ynxly2RVyHUrPY=' 
WHERE 
  key_id = '811b21842a8003e971a130cb95140152c04b158c395daec2f8996ac057d62c8c' 
  AND (
    token = 's0ODy5STOxL6uuyQegVxxaUWY7j42ynxly2RVyHUrPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030