UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/a2OLiE7fnWfmnJrFEwXBgjU+SNJ877Qapij2Fz06zI=' 
WHERE 
  key_id = '5b3637b91947aa1ac9f66824711a1a6d1abbbeb0b534b9d8b554549f0406ed2c' 
  AND (
    token = '/a2OLiE7fnWfmnJrFEwXBgjU+SNJ877Qapij2Fz06zI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041