UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IsiA4jH8NFewzH1A+bNJiDOI/ZkplTPtCD/f/zI2ykk=' 
WHERE 
  key_id = '756ce9b0c5278f154e6c6f862d98e12e6157983281080151960bf3c3ec37563f' 
  AND (
    token = 'IsiA4jH8NFewzH1A+bNJiDOI/ZkplTPtCD/f/zI2ykk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037