UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nTextIauR05FoTOMpn69lBkDglM2f23CQO34UdtLMfo=' 
WHERE 
  key_id = 'd5e41a05e8024cc3aa47884308b7750f1fae4665e520fd9bbed8d29ba4705c54' 
  AND (
    token = 'nTextIauR05FoTOMpn69lBkDglM2f23CQO34UdtLMfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035