UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7TP/3dktGoxmgoQvy+yZMW7sxkE+xHVxLLXM//248HQ=' 
WHERE 
  key_id = 'b25ff359a41cce283630d8614ee3947d3bd7e4ab87d5484a692a6064c0d2167a' 
  AND (
    token = '7TP/3dktGoxmgoQvy+yZMW7sxkE+xHVxLLXM//248HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036