UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KkpxMibA/5/EGR7XxcFhiNCtMvV9HzKXyCmxZDQBN9g=' 
WHERE 
  key_id = '4ae6439026f63816f944cb76449846247d8154468eb09be600df36780ed7778a' 
  AND (
    token = 'KkpxMibA/5/EGR7XxcFhiNCtMvV9HzKXyCmxZDQBN9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027