UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tX1sxhseDrB9AWI6R7w386hCaCCebs4sbm1LMkrd7yo=' 
WHERE 
  key_id = 'eba73cb655e8cb0c5f32f666c8c9d48c120eea0338d794fab201fd86cfd42226' 
  AND (
    token = 'tX1sxhseDrB9AWI6R7w386hCaCCebs4sbm1LMkrd7yo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046