UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'swcBfeVI+lHeOPqVN6ATuiqmJPC9LzcCwMbwL6VIbic=' 
WHERE 
  key_id = '6bc47f9cc609e675bc32f70988d3d25ae5f39ca3ca933a89325a83c3478c002a' 
  AND (
    token = 'swcBfeVI+lHeOPqVN6ATuiqmJPC9LzcCwMbwL6VIbic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045