UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lfy9QCG+JU8lORI1jpMyJGUtbLxQV6+xLzBzUhoJDB4=' 
WHERE 
  key_id = '1cc99771a0c2369207720e04956e76fe61d160153a2019adba1c5eec419cce32' 
  AND (
    token = 'Lfy9QCG+JU8lORI1jpMyJGUtbLxQV6+xLzBzUhoJDB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028