UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '03aP6uZEI3G0ZfbNsg/OyUNB2UWashtr7onueuEhzKU=' 
WHERE 
  key_id = '2f143192d7564a69e2f205079e0b70cfb285726bc8c71a976f2d6bc7404f048f' 
  AND (
    token = '03aP6uZEI3G0ZfbNsg/OyUNB2UWashtr7onueuEhzKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028