UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MsHWVVtibhOFwd7ik2iiLk7F8YFnYn3Db3EVIDSwY1s=' 
WHERE 
  key_id = '0e72b05781b5f2b94e05b4ecedbf692ff278394e2bcfc0787a305ab99ad5a369' 
  AND (
    token = 'MsHWVVtibhOFwd7ik2iiLk7F8YFnYn3Db3EVIDSwY1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057