UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nnCPT2ZtNcBnRdUpeSptUmrVwsAEvXhcYuPnLr8LEc8=' 
WHERE 
  key_id = '2e414faaec6d7b8bb39946e975ae153aec6fb0fbd33d5db185573f3200777b29' 
  AND (
    token = 'nnCPT2ZtNcBnRdUpeSptUmrVwsAEvXhcYuPnLr8LEc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036