UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ABP+VwknfIT1952+m9ym0ZxgKPTxikYWoCUJ9dhb+E=' 
WHERE 
  key_id = 'cb2089743cbce54ffb2084b2c61ede0b9c0c6b01bf6b398d77bb987b2c21cfc9' 
  AND (
    token = '5ABP+VwknfIT1952+m9ym0ZxgKPTxikYWoCUJ9dhb+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028